﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CardLogistics.Web.Components;
using System.Data;
using CardLogistics.Model.CardArrival;

namespace CardLogistics.Web.MainPage.CardArrival.StorageCheck
{
    public partial class Detail : BasePage
    {
        private static readonly CardLogistics.DAL.CardArrival.Storage_Check_CardData DAL = new DAL.CardArrival.Storage_Check_CardData();
        private static readonly CardLogistics.DAL.CardArrival.Storage_Detailed_CardData DetailDAL = new DAL.CardArrival.Storage_Detailed_CardData();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitControl();
            }
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public void InitControl()
        {
            string _key = Request.QueryString["id"];
            WebUserControl_AppInfo1.InfoID = _key;
            WebUserControl_AppInfo1.UserID = LoggedUser.ID;
            if (!string.IsNullOrEmpty(_key))
            {
                Storage_Check_Card sData = DAL.GetModel(_key);
                SetWebControls(this.Page, sData);
                STORAGEDATE.Text = Convert.ToDateTime(sData.STORAGEDATE).ToShortDateString();//入库日期
               //入库详细
                DataTable dt = DetailDAL.GetInfoByCheckId(sData.ID);
                    rptDetailList.DataSource = dt;
                    rptDetailList.DataBind();
            }
        }
    }
}